package cn.hou.java.designpattern._06strategy;

//策略容器类,执行指定的策略
public class Context {
	
	//引用策略
	private Strategy strategy;

	public Context(Strategy strategy) {
		this.strategy = strategy;
	}
	
	public void plan() {
		strategy.plan();//调用传递进来的某一个策略的具体实现方法
	}

	public Strategy getStrategy() {
		return strategy;
	}

	public void setStrategy(Strategy strategy) {
		this.strategy = strategy;
	}
}
